package adapter;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.ItemBean;
import student.andlei.com.student.R;

public class MineFragmentSetepAdapter extends BaseQuickAdapter<ItemBean,BaseViewHolder>{

    private Context context;
    public MineFragmentSetepAdapter(Context context ,int layoutResId, @Nullable List data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, ItemBean item) {
        TextView textView = helper.getView(R.id.tv_item_mine_setep);
        textView.setText(item.str);
        if(item.isSelect == 1){
            textView.setTextColor(Color.WHITE);
            helper.getView(R.id.lay_item_mine_setep).setBackgroundResource(R.color.homepage_titlefont);

            Drawable dra= context.getResources().getDrawable(R.mipmap.morebai2x);
            dra.setBounds( 0, 0, dra.getMinimumWidth(),dra.getMinimumHeight());
            textView.setCompoundDrawables(null, null, dra,null);

        }else {
            textView.setTextColor(0xFF333333);
            helper.getView(R.id.lay_item_mine_setep).setBackgroundResource(R.color.appstyletitlecolor);

            Drawable dra= context.getResources().getDrawable(R.mipmap.morehui);
            dra.setBounds( 0, 0, dra.getMinimumWidth(),dra.getMinimumHeight());
            textView.setCompoundDrawables(null, null, dra,null);
        }
    }


}
